home *** CD-ROM | disk | FTP | other *** search
/ Complete RPG Maker XP - 41 Games / tg esp 48 rpg maker.iso / RPG3D / Tools_Utilities / Quark.exe / Quark / help / zips / OOP_examples.ZIP / mapcircles.py < prev    next >
Encoding:
Python Source  |  2003-05-21  |  809 b   |  17 lines

  1. import quarkpy.qmacro   # to bring in qmacro functions we need
  2. import quarkx           # to bring in quarkx functions we need
  3. from circles import *   # to bring in all of our circle class
  4.  
  5. def printcir(self):
  6.     circle = Circle(1,0,3,1.5)  # assigns values to the attributes
  7.     circle.circumference()      # passes the values to circle class
  8.     answer = circle.circumference()  # collects the 'return' data
  9.     print answer                # prints the answer to the console
  10.  
  11. def WindowClick(self):
  12.     import quarkpy.mapoptions   # brings in the 'Options' menu
  13.     printcir(self)              # calls our function
  14.     quarkx.console(1)           # brings the console into view
  15.  
  16. quarkpy.mapoptions.items.append(quarkpy.qmenu.item("&Print Cir.", 
  17. WindowClick)) # adds it to the 'Options' menu